# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-io-socket-portstate
_pkgname=IO-Socket-PortState
pkgver=0.03
pkgrel=14
pkgdesc='Perl extension for checking the open or closed status of a port..'
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl>=0')
url='http://search.cpan.org/~dmuey/IO-Socket-PortState-0.03/PortState.pm'
source=("http://search.cpan.org/CPAN/authors/id/D/DM/DMUEY/$_pkgname-$pkgver.tar.gz")
sha512sums=('84353b041558b5401f207d350b66ef696a9f3b23bddb845da76a98b072fe64f9761eb9f10e797744b5241d5eac606769ecc24cdfefb16669f446cf21968220e4')

build() {
  cd "$_pkgname-$pkgver"
  (
    export PERL_MM_USE_DEFAULT=1 PERL5LIB="" PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

    /usr/bin/perl Makefile.PL

    make
  )
}

package() {
  cd "$_pkgname-$pkgver"

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

